package com.mobile.util;

import org.springframework.context.ApplicationContext;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName : Const.java
 * @Decription : 项目名称
 * @Version : 2018/01/11  hlh  新建作成   1.0
 */
public class Const {
	public static final String USER_TOKEN = "token";    //toekn
	public static final String SESSION_SECURITY_CODE = "sessionSecCode";    //验证码
	public static final String SESSION_USER = "sessionUser";                //session用的用户
	public static final String sSESSION_ROLE_RIGHTS = "sessionRoleRights";
	public static final String SESSION_menuList = "menuList";                //当前菜单
	public static final String SESSION_allmenuList = "allmenuList";            //全部菜单
	public static final String SESSION_QX = "QX";
	public static final String SESSION_QX_LIST = "QX_LIST";
	public static final String SESSION_QX_MENU = "QX_MENU";                    //菜单权限
	public static final String USER_AUTHOR_CACHE = "author_cache";                    //用户权限缓存
	public static final String SESSION_USERCODE = "USERCODE";                    //用户账号
	public static final String SESSION_USERNAME = "USERNAME";                //用户名
	public static final String SESSION_USERROLE = "USERROLE";                    //用户角色代号
	public static final String TRUE = "T";
	public static final String FALSE = "F";
	public static final String LOGIN = "/login_toLogin.do";                    //登录地址
	public static final String SYSNAME = "admin/config/SYSNAME.txt";        //系统名称路径
	public static final String PAGE = "admin/config/PAGE.txt";                //分页条数配置路径
	public static final String EMAIL = "admin/config/EMAIL.txt";            //邮箱服务器配置路径
	public static final String SMS1 = "admin/config/SMS1.txt";                //短信账户配置路径1
	public static final String SMS2 = "admin/config/SMS2.txt";                //短信账户配置路径2
	public static final String FWATERM = "admin/config/FWATERM.txt";        //文字水印配置路径
	public static final String IWATERM = "admin/config/IWATERM.txt";        //图片水印配置路径
	public static final String WEIXIN = "admin/config/WEIXIN.txt";        //微信配置路径
	public static final String WEBSOCKET = "admin/config/WEBSOCKET.txt";    //WEBSOCKET配置路径
	public static final String APPEDITION = "admin/config/APPEDITION.txt";    //APP版本号
	public static final String LOGINEDIT = "admin/config/LOGIN.txt";        //登录页面配置
	public static final String FILEPATHIMG = "uploadFiles/uploadImgs/";        //图片上传路径
	public static final String FILEPATHFILE = "uploadFiles/file/";            //文件上传路径
	public static final String FILEPATHFILEOA = "uploadFiles/uploadFile/";    //文件上传路径(oa管理)
	public static final String FILEPATHTWODIMENSIONCODE = "uploadFiles/twoDimensionCode/"; //二维码存放路径
	public static final String NO_INTERCEPTOR_PATH = ".*/((login)|(logout)|(code)|(app)|(weixin)|(static)|(main)|(websocket)).*";    //不对匹配该值的访问路径拦截（正则）
	public static ApplicationContext WEB_APP_CONTEXT = null; //该值会在web容器启动时由WebAppContextListener初始化
	public static final String APPREQUESTPATHSTART = "/app_";    // 手机 app 请求路径以此开头
	public static final String APPLOGIN = ".*/((login)|(logout)|(smsSend)|(pwdMissInfoCheck)|(code)|(passwordReset)).*";    // 手机 app 访问过滤地址
	//	public static final String STATIC_FILE_PATH = "/file";	// linux静态资源存放路径


	/* 角色代号 */
	public static final String ROLE_CODE_MARKET = "market";        //市场部角色代号
	public static final String ROLE_CODE_HR = "hr";                //综管部角色代号
	public static final String ROLE_CODE_QUALITY = "quality";    //质量部角色代号
	public static final String ROLE_CODE_FINANCE = "finance";    //财务部角色代号
	public static final String ROLE_CODE_PRODUCT = "product";    //生产部角色代号
	public static final String ROLE_CODE_MAINTAIN = "maintain";    //维修部角色代号
	public static final String ROLE_CODE_MANAGER = "manager";    //总经理角色代号
	public static final String ROLE_CODE_TECHNIC = "technic";    //研发部角色代号
	public static final String ROLE_CODE_ADMIN = "admin";        //平台运维角色代号
	public static final String ROLE_CODE_DETONA = "detona";        //雷管厂角色代号
	public static final String ROLE_CODE_BLASTCOMPANY = "blastCompany";        //爆破单位角色代号

	// 处理结果类型
	public static final String ACTION_RESULT = "result";
	public static final String ACTION_MESSAGE = "message";
	public static final String ACTION_RESULT_SUCCESS = "success";
	public static final String ACTION_RESULT_FAILED = "failed";
	public static final String ACTION_RESULT_EXCEPTION = "exception";
	public static final String ACTION_RESULT_TO_LOGIN = "to_login";
	// service层业务处理返回值常量
	public static final int NO_DATA = 0;                // 数据不存在
	public static final int DATA_ALREADY_EXIST = -1;    // 数据已经存在
	public static final int DATA_NOT_EXIST = -2;        // 数据不存在
	public static final int DATA_NOT_NEWEST = -3;        // 非最新数据
	public static final int DATA_IS_REFERENCED = -4;    // 数据被引用
	public static final int DATA_DEL_FAILED = -5;        // 删除失败
	public static final String DATA_ACCESS_FAILED = "-6";    // 数据访问权限校验失败

	// 菜单/按钮权限
	public static final String AUTH_HAVE = "1";
	public static final String AUTH_NONE = "0";


	// 账户锁定标志 ( 1：正常；0：锁定；2：删除)
	public static final String IS_LOCKED = "IS_LOCKED";
	public static final String IS_LOCKED_1 = "1";
	public static final String IS_LOCKED_0 = "0";
	public static final String IS_LOCKED_2 = "2";


	/**
	 * APP Constants
	 */
	//系统用户注册接口_请求协议参数)
	public static final String[] SYSUSER_REGISTERED_PARAM_ARRAY = new String[]{"USERNAME", "PASSWORD", "NAME", "EMAIL", "rcode"};
	public static final String[] SYSUSER_REGISTERED_VALUE_ARRAY = new String[]{"用户名", "密码", "姓名", "邮箱", "验证码"};

	//app根据用户名获取会员信息接口_请求协议中的参数
	public static final String[] APP_GETAPPUSER_PARAM_ARRAY = new String[]{"USERNAME"};
	public static final String[] APP_GETAPPUSER_VALUE_ARRAY = new String[]{"用户名"};


	// 配置文件后缀
	public static final String PROPERTIES_PRIX = "dev";
	public static final String PROPERTIES_PATH_NET = "E:\\kcdzsys\\configs\\IotSys-net\\";
	public static final String PROPERTIES_PATH_FUNC = "E:\\kcdzsys\\configs\\IotSys-function\\";
	public static final String PROPERTIES_PATH_API = "E:\\kcdzsys\\configs\\IotSbm-api\\";
	public static final String PROPERTIES_PATH_SBMAPI = "E:\\kcdzsys\\configs\\SbmSys-api\\";
	public static final String PROPERTIES_PATH_SBMWEB = "E:\\kcdzsys\\configs\\SbmSys-web\\";


	public static final String FUNCTION_EVENT = "FUNCTION_EVENT";//菜单事件
	public static final String EVENT_URL = "EVENT_URL";//菜单事件url集合

	public static final String PRODUCTION_LINE = "PRODUCTION_LINE";//产线
	public static final String[] ALLOW_ERP_DEP_ID = new String[]{"延时控制电路一车间", "延时控制电路二车间", "延时控制电路三车间"};//允许匹配ERP部门编号的部门名称


/*
	25.6.23 新增常量
*/
	public static final String FILE_TYPE_WORD = "WORD";//word 文档
	public static final String FILE_TYPE_PPT = "PPT";//pdf 文档
	public static final String FILE_TYPE_VIDEO = "VIDEO";//视频文件
	public static final String FILE_TYPE_IMAGE = "IMAGE";//图片文件
	/*假对手常量值*/
	public static final String FAKE_HANDS = "fake_hands";  //50 王宝瑞 148 崔彤  149 张潇帅 150 张健鹏
	public static final String SYSTEM_CONFIG = "system_config";  //50 王宝瑞 148 崔彤  149 张潇帅 150 张健鹏

	   // 答题选择题的选项集合
	   public static final List<String> CHOICES = Arrays.asList("A", "B", "C", "D");
	// 答题判断题的选项集合
	   public static final String JUDGE_RIGHT = "正确";
	   public static final String JUDGE_ERROR = "错误";
	   //答题正确概率
	   public static final double QUIZ_RIGHT_RATE = 0.85;
	   //重置 npc 题库默认用户
	   public static final String  REFRESH_USER = "batch";
	   //ppt 转图片质量
	   public static final Integer   PPT_CONVERT_IMAGE_DPI = 50;


	public static final String ROLE_ADMIN = "admin";


}
